/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package tableCellRender;

import java.awt.Color;
import java.awt.Component;
import javax.swing.DefaultCellEditor;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;
import otros.Util;

/**
 *
 * @author FERRETERIA
 */
public class Select implements TableCellRenderer  {
    private int filaSel;
    private boolean fuera;

    public Select (int fila, boolean fuera) {
        super();
        filaSel = fila;
        this.fuera = fuera;
    }
    
    @Override
    public Component getTableCellRendererComponent(final JTable jtable, Object value, boolean selected, boolean focused, int row, int column) {
        JCheckBox t = new JCheckBox();
        t.setBorder(null);
        t.setOpaque(true);
        t.setSelected(Boolean.parseBoolean(value.toString()));
        t.setBackground(Util.getBackground(row,filaSel,jtable, selected, fuera));
        t.setForeground(Util.getForeground(row,filaSel,jtable,selected, fuera));          
        return t;
    }
    
}
